package org.gd.mongodb;

import com.mongodb.BasicDBObject;

import java.io.Serializable;

public class MongoTestUser implements Serializable {

    private static final long serialVersionUID = -4415279469780082174L;

    private Long id;
    private String name;
    private String login;

    public MongoTestUser() {
    }

    public MongoTestUser(Long id, String name, String login) {
        this.id = id;
        this.name = name;
        this.login = login;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getLogin() {
        return login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public BasicDBObject toBasicDBObject() {
        BasicDBObject object = new BasicDBObject();
        object.put("name", name);
        object.put("login", login);
        return object;
    }

    @Override
    public String toString() {
        return "MongoTestUser {" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", login='" + login + '\'' +
                '}';
    }
}
